import java.util.Scanner;

public class Test6 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入一个正整数:>");
        int a=sc.nextInt();
        System.out.print("请输入一个正整数:>");
        int b=sc.nextInt();
        int c=a%b;
        while(c!=0){
            a=b;
            b=c;
            c=a%b;
        }
        System.out.println("最大公约数是"+b);
    }
}
